//
//  PassengerMsgCell.m
//  JiongTu
//
//  Created by 杨璟 on 16/4/7.
//  Copyright © 2016年 YSKJ. All rights reserved.
//

#import "PassengerMsgCell.h"

#import "JTPassengerTrip.h"

#import "JTUser.h"

#import "UIImageView+WebCache.h"

@interface PassengerMsgCell ()

@property (weak, nonatomic) IBOutlet UIImageView *iconView;

@property (weak, nonatomic) IBOutlet UILabel *nameLabel;

@property (weak, nonatomic) IBOutlet UILabel *startLabel;

@property (weak, nonatomic) IBOutlet UILabel *endLabel;

@property (weak, nonatomic) IBOutlet UILabel *timeLabel;

@property (weak, nonatomic) IBOutlet UILabel *identityLabel;

@property (weak, nonatomic) IBOutlet UILabel *seatLabel;

@end

@implementation PassengerMsgCell

- (void)layoutSubviews {
    [super layoutSubviews];
    
    //固定为故事版中的宽度一半
    self.iconView.layer.cornerRadius = 29;
    self.iconView.layer.masksToBounds = YES;
}

- (void)setOneTrip:(JTPassengerTrip *)oneTrip {
    _oneTrip = oneTrip;
    
    [self.iconView sd_setImageWithURL:oneTrip.passenger.iconPath placeholderImage:[UIImage imageNamed:@"头像占位"]];
    self.nameLabel.text = oneTrip.passenger.nickname;
    self.identityLabel.text = oneTrip.identity;
    self.startLabel.text = oneTrip.start;
    self.endLabel.text = oneTrip.end;
    self.timeLabel.text = oneTrip.time;
    self.seatLabel.text = [oneTrip.orderSeatNumber stringValue];
}

@end
